/**
 * Created by cjd on 2016/6/13.
 */
angular.module("app").controller("settingCtrl", ["$scope", "$http", "org", function ($scope, $http, org) {
    $scope.saveOrg = function () {
        if(confirm("是否确定执行该操作?")){
            delete $scope.orgInfo.createTime;
            org.saveOrg({}, $scope.orgInfo, function (data) {
                if (data.statusCode == 0) {
                    alert("操作成功!");
                }
            });
        }
    };
    $scope.orgInfo = $scope.userInfo.organization;
    $scope.provinceChange = function(){
        $scope.orgInfo.city = city.filter(function(item){
            return item.ProID == $scope.orgInfo.province;
        })[0].CityID;
    };
    $scope.cityChange = function(){
        $scope.orgInfo.county = District.filter(function(item){
            return item.CityID == $scope.orgInfo.city;
        })[0].Id;
    }
}]);